async: a vectored write the caller can await (into stable) - #25
Merged
Conversation
The vectored write is fire-and-forget in both of its modes: the completion sends no notification and the release callback carries no status. A caller that needs the outcome therefore has to use the single-buffer write, which does not take the buffer over — so it must free it itself, and the only moment it can is when its own wait ends. Those are different moments once the waiting coroutine is cancelled: the wait is over and the write is not. ZEND_ASYNC_IO_WRITEV_AWAIT says the caller waits. Ownership stays the mode's; the completion keeps the request alive and notifies io->event with the request as the result and no exception, so a caller matching by request pointer wakes and no sibling awaiter on the same handle does. Header only: the flag word already existed, so no signature changes and the existing values keep their meaning.
async: a vectored write the caller can await
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries the three commits of #24 from
true-asyncintotrue-async-stable: theZEND_ASYNC_IO_WRITEV_AWAITflag, the mode mask beside it, and theZEND_ASYNC_IO_WRITEV_AWAITEDmacro.Header only, and additive — the flag word already existed, so no signature changes and the two existing mode values keep their meaning.
Reactor half: true-async/php-async#262. Consumer: true-async/server#186, where a cancelled HTTP/1 handler frees a frame libuv still points at, because the only write that reports its status is also the only one that leaves the buffer with the caller.